package com.smfx.yxt.common.enums;

public enum ResourceType {
	
	MENU("M", "菜单"),
	PAGE("P", "页面"),
	BUTTON("O", "按钮");

	private final String code;
	
	private final String value;
	
	private ResourceType(String code, String value) {
		this.code = code;
		this.value = value;
	}

	public static String getValue(String key) {
		for(ResourceType type : ResourceType.values()) {
			if(type.getCode().equals(key)) {
				return type.getValue();
			}
		}
		return null;
	}
	
	public String getCode() {
		return code;
	}

	public String getValue() {
		return value;
	}
	
}
